package Chapter09.HomeWork;

import java.util.Scanner;

public class Work02 {
    public static void error() throws Exception{
        int avg;//平均数
        System.out.println("**********");
        Scanner input=new Scanner(System.in);
        System.out.println("输入总课时：");
        int time=input.nextInt();
        System.out.println("请输入总课时数：");
        int num=input.nextInt();
        avg=time/num;
        if(time<100){
            throw new Exception("课时太少");
        }
        if(num==0){
            throw new Exception("除数不为0");
        }
        System.out.println("平均课时："+avg);
    }
    public static void main(String[] args) {
        try {
            error();
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
